home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Add-Ons / HyperCard / SoundLevel XFCN 1.0.0 / SoundLevel.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-07  |  1.5 KB  |  65 lines  |  [TEXT/CWIE]

  1. /* ----------------------------------------------------------------------
  2.  
  3.     SoundLevel XFCN
  4.     version 1.0.0
  5.     
  6.     Written by: Paul Celestin
  7.     
  8.     Copyright © 1996 Celestin Company, Inc.
  9.     
  10.     This XFCN returns the current sound level.
  11.     
  12.     No parameters required!
  13.     
  14.     960707 - 1.0.0 - initial release
  15.  
  16. ---------------------------------------------------------------------- */
  17.  
  18. #include <A4Stuff.h>
  19. #include <HyperXCmd.h>
  20. #include <Sound.h>
  21.  
  22. #define PARAMETER_NUMS        0
  23. #define PARAMETER_TEXT        "\pNo parameters required!"
  24.  
  25.  
  26. /* ----------------------------------------------------------------------
  27. prototypes
  28. ---------------------------------------------------------------------- */
  29. void DoIt(XCmdPtr paramPtr);
  30. char LookUp[256];
  31.  
  32.  
  33. /* ----------------------------------------------------------------------
  34. main
  35. ---------------------------------------------------------------------- */
  36. pascal void main(XCmdPtr paramPtr)
  37. {
  38.     Str255 copyright = "\pCopyright © 1996 Celestin Company, Inc.";
  39.     long oldA4 = SetCurrentA4();
  40.     if (paramPtr->paramCount != PARAMETER_NUMS)
  41.     {
  42.         paramPtr->returnValue =
  43.             PasToZero(paramPtr,PARAMETER_TEXT);
  44.     }
  45.     else
  46.     {
  47.         DoIt( paramPtr );
  48.     }
  49.     SetA4(oldA4);
  50. }
  51.  
  52. /* ----------------------------------------------------------------------
  53. DoIt
  54. ---------------------------------------------------------------------- */
  55. void DoIt(XCmdPtr paramPtr)
  56. {
  57.     short        theVolume;
  58.     Str255        theString;
  59.  
  60.     GetSoundVol(&theVolume);
  61.     NumToStr(paramPtr,theVolume,theString);
  62.  
  63.     paramPtr->returnValue = PasToZero(paramPtr,theString);
  64. }
  65.